/**
 * Note Form
 */
.diff-file .diff-content {
  .diff-tr.line_holder:hover > .diff-td .line_note_link,
  tr.line_holder:hover > td .line_note_link {
    opacity: 1;
    filter: alpha(opacity = 100);
  }
}

.diff-file,
.discussion {
  .new-note {
    margin: 0;
    border: 0;
  }
}

.new-note,
.note-edit-form {
  .note-form-actions {
    position: relative;
    margin: $gl-padding 0 0;
  }

  img {
    max-width: 100%;
  }
}

.note-textarea {
  display: block;
  padding: 10px 16px;
  color: $gl-text-color;
  font-family: $regular-font;
  border: 0;

  &:focus {
    outline: 0;
  }
}

.note-image-attach {
  margin-left: 45px;
  float: none;
}

.common-note-form {
  .md-area {
    border: 1px solid $gray-400;
    border-radius: $border-radius-large;
    transition: border-color ease-in-out 0.15s,
      box-shadow ease-in-out 0.15s;
    background-color: $white;

    &.is-dropzone-hover {
      border-color: $green-500;
      box-shadow: 0 0 2px $black-transparent,
        0 0 4px $green-500-focus;

      .comment-toolbar,
      .nav-links {
        border-color: $green-500;
      }
    }

    &:hover,
    &:focus-within {
      @include gl-shadow-md;
    }

    &:hover {
      border: 1px solid $gray-500;
    }

    &:focus-within {
      border: 1px solid $gray-900;
    }

    // Add focus
    .zen-backdrop:not(.fullscreen) textarea {
      width: calc(100% - 4px);
      margin: 2px;
      padding-left: calc(#{$gl-spacing-scale-5} - 2px);

      .gl-dark & {
        width: calc(100% - 6px);
        margin: 2px 3px;
        padding-left: calc(#{$gl-spacing-scale-5} - 3px);
      }

      &:focus {
        @include gl-focus;
      }
    }

    .note-textarea-rounded-bottom {
      border-bottom-left-radius: calc(#{$border-radius-large} - 1px);
      border-bottom-right-radius: calc(#{$border-radius-large} - 1px);
    }
  }
}

.md-header {
  min-height: 32px;
}

.md-header .nav-links {
  display: flex;
  flex-flow: row wrap;
  width: 100%;

  .float-right {
    // Flexbox quirk to make sure right-aligned items stay right-aligned.
    margin-left: auto;
  }
}


.md-header .gl-tabs-nav {
  border-bottom: 0;
}

.issuable-note-warning {
  color: $orange-600;
  background-color: $orange-50;
  border-radius: $border-radius-default $border-radius-default 0 0;
  padding: 3px 12px;
  margin: auto;
  align-items: center;

  a {
    color: $orange-600;
    text-decoration: underline;
  }

  .icon {
    margin-right: $issuable-warning-icon-margin;
    vertical-align: text-bottom;
    fill: $orange-600;
  }

  + .md-area {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  .disabled-comment {
    border: 0;
    border-radius: $label-border-radius;
    padding-top: $gl-vert-padding;
    padding-bottom: $gl-vert-padding;
  }
}

.sidebar-item-icon {
  border-radius: $border-radius-default;
  margin: 0 5px 0 0;
  vertical-align: text-bottom;

  &.is-active {
    fill: $orange-600;
  }

  .sidebar-collapsed-icon & {
    margin: 0;
  }

  .sidebar-item-value & {
    fill: $gray-500;
  }
}

.sidebar-item-warning-message {
  line-height: 1.5;
  padding: 16px;

  .text {
    color: $text-color;
  }

  .sidebar-item-warning-message-actions {
    display: flex;

    .btn {
      flex-grow: 1;
    }
  }
}

.discussion-form {
  background-color: $white;

  @include media-breakpoint-down(xs) {
    .user-avatar-link {
      display: none;
    }

    .note-edit-form {
      margin-left: 0;
    }
  }
}

table {
  .discussion-form-container {
    padding: $gl-padding;
  }
}

.discussion-notes .disabled-comment {
  padding: 6px 0;
}

.notes.notes-form > li.timeline-entry {
  @include notes-media('max', map-get($grid-breakpoints, md) - 1) {
    padding: 0;
  }

  .timeline-content {
    @include notes-media('max', map-get($grid-breakpoints, md) - 1) {
      margin: 0;
    }
  }

  .timeline-entry-inner {
    border: 0;
  }
}

// Snippets are the only non-vue form left
.snippets.note-edit-form {
  display: none;
}

.note-edit-form {
  font-size: 14px;

  .md-area {
    background-color: $white;
    @include gl-rounded-base;
  }
}

.js-note-attachment-delete {
  display: none;
}

.error-alert > .alert {
  margin-top: 5px;
  margin-bottom: 5px;

  &.alert-dismissable {
    .close {
      color: $white;
      opacity: 0.85;
      font-weight: $gl-font-weight-normal;

      &:hover {
        opacity: 1;
      }
    }
  }
}

.discussion-body,
.diff-file,
.commit-diff {
  .discussion-reply-holder {
    border-radius: 0 0 $gl-border-radius-base $gl-border-radius-base;
    padding: 0 $gl-padding $gl-padding-12 $gl-padding;
    border-top: 1px solid $gray-50;

    + .new-note {
      border-top: 1px solid $gray-50;
    }

    &.is-replying {
      padding-top: $gl-padding-12;
    }

    &.internal-note,
    &.internal-note.is-replying {
      padding-top: $gl-padding-12 !important;
    }

    .user-avatar-link {
      img {
        margin-top: -3px;
      }
    }
  }
}

.diff-td > .content > .discussion-reply-holder {
  padding-top: $gl-padding-12;
  @include gl-bg-gray-10;
}

.discussion-with-resolve-btn {
  @include media-breakpoint-up(sm) {
    display: flex;
  }

  .discussion-actions {
    display: table;

    svg {
      fill: $gray-500;
    }

    .btn-group {
      display: table-cell;

      &:first-child {
        padding-right: 0;
      }

      &:first-child:not(:last-child) > div {
        border-right: 0;
      }
    }
  }
}

.discussion-reply-holder {
  .reply-placeholder-text-field {
    @include gl-font-monospace;
    border-radius: $gl-border-radius-base;
    width: 100%;
    resize: none;
    padding: $gl-padding-8 $gl-padding-12;
    line-height: 1;
    border: 1px solid $gray-200;
    background-color: $white;
    overflow: hidden;
    transition: border-color ease-in-out 0.15s,
      box-shadow ease-in-out 0.15s;

    @include media-breakpoint-down(xs) {
      margin-bottom: $gl-padding-8;
    }

    &:hover {
      border: 1px solid $gray-500;
    }
  }
}

.comment-toolbar {
  color: $gl-text-color-secondary;
}

.toolbar-button {
  padding: 0;
  background: none;
  border: 0;
  font-size: 14px;
  line-height: 16px;

  &:hover,
  &:focus {
    color: $blue-600;
    outline: 0;
  }

  @include media-breakpoint-up(md) {
    float: left;
    margin-right: $gl-padding;

    &:last-child {
      float: right;
      margin-right: 0;
    }
  }
}

.toolbar-text {
  font-size: 14px;
  line-height: $gl-spacing-scale-7;
}

.note-form-actions {
  color: $gl-text-color;

  @include media-breakpoint-down(xs) {
    .btn {
      float: none;
      width: 100%;
    }
  }
}

.note-edit-warning.settings-message {
  display: none;
  padding: 5px 10px;
  position: absolute;
  left: 127px;
  top: 2px;

  @include media-breakpoint-down(xs) {
    position: relative;
    top: 0;
    left: 0;
    margin-bottom: 10px;
  }
}

.comment-type-dropdown {
  @include media-breakpoint-down(xs) {
    display: flex;
    width: 100%;
    margin-bottom: 10px;

    .btn-success {
      flex-grow: 1;
      flex-shrink: 0;
      width: auto;
    }

    .dropdown-toggle {
      flex-grow: 0;
      flex-shrink: 1;
      width: auto;
    }
  }
}

.uploading-container {
  float: right;

  @include media-breakpoint-down(xs) {
    float: left;
    margin-top: 5px;
  }

  button {
    font-size: $gl-font-size-sm !important;
  }
}

.uploading-error-icon,
.uploading-error-message {
  color: $red-500;
}

.uploading-error-message {
  @include media-breakpoint-down(xs) {
    &::after {
      content: '\a';
      white-space: pre;
    }
  }
}

.uploading-progress {
  margin-right: 5px;
}

.markdown-selector {
  color: $blue-600;
}

.comment-warning-wrapper {
  transition: border-color ease-in-out 0.15s,
    box-shadow ease-in-out 0.15s;
}
